#ifndef CONFIG_H
#define CONFIG_H

#include <iostream>
#include <fstream>
#include <utility>
#include <vector>
#include <string>
#ifdef QT_CORE_LIB
#include <QtCore>
#endif

class Config
{
  private:
    std::vector< std::pair< std::string, std::string > > configData;
    std::ifstream in;

  public:
    Config();
    Config(std::string fileName);
    bool parseFile(std::string fileName);
    std::string getValue(std::string key);
#ifdef QT_CORE_LIB
    QString getValue(QString key);
#endif
    void print();
    void clear();
  private:
    bool openFile(std::string fileName);
    void closeFile();
    void stripComments(std::string &str);
    void stripSpaces(std::string &str);
    bool parseLine(std::string line);
};

#endif
